<?php 
$id = getId();
$arr = $this->get('post');?>
	<form action="<?php _baseUrl()?>/Diploma/Index/delete"  method="post" id="f<?php _e($id);?>">
			
			<div class="x-list-title">
				<table width="100%" border="0" height="100%">
				<tr>
					<td align="left">
						<h2>
							Danh sách công văn đến
						</h2>
					</td>
					<td align="right">	
						<div class="x-list-options">
							<a href="#Diploma/index/add" class="x-button">Thêm công văn đến</a>
							<div class="x-options-container">
								<a class="x-button"> Tác vụ khác <span class="x-tri">&#9660;</span></a>
								<div class="x-options">
									<a href="#Diploma/Indexs/Add" class="x-options-item x-track">Thêm công văn đi</a>
									<a onclick="module_ajax('<?php _moduleUrl($this);?>/Act/delete','f<?php _e($id);?>',this)" class="x-options-item" >Xóa công văn</a>
								</div>
							</div>
						</div>
					</td>
				</tr>
				</table>	
			</div>
		<table width="100%" cellpadding="5" class="x-list" >
			<tr>
				<th width="25" align="center">TT</th>
				
				<th width="65">
					<?php show_order_link('Loại cv','subtype','#Diploma',$vars) ;?>
				</th>
				<th width="140">
					<?php show_order_link('Số hiệu','code','#Diploma',$vars) ;?>
				</th>
				<th width="100">
					<?php show_order_link('Ngày đến','date_get','#Diploma',$vars) ;?>
				</th>
				<th width="100">
					<?php show_order_link('Ban hành','date_enactment','#Diploma',$vars) ;?>
				</th>
				
				<th width="140">
					<?php show_order_link('Cơ quan ban hành','ogran_by','#Diploma',$vars) ;?>
				</th>
				<th >
					<?php show_order_link('Trích yếu','abstracts','#Diploma',$vars) ;?>
				</th>
				
				<th  colspan="2">Tác vụ</th>
				
				<th align="center" width="25">
					<div class="x-check-container">
						<div class="x-check">
						<input type="checkbox" class="x-checkbox x-checkall"/>
						</div>
						<div class="x-check-options">
							<a class="x-check-item check-all">Chọn tất cả</a>
							<a class="x-check-item uncheck-all">Bỏ chọn tất cả</a>
						</div>
					</div>
				</th>
			</tr>
			<?php
			if(count($arr)==0){
				_e("<tr><td class='x-page' align='center' colspan='11'>Chưa có công văn nào được tạo </td></tr>");
			}else{
				foreach( $arr as $k=>$a ){?>
				<tr>
					<td  align="center"><?php _e($k+1);?></td>
					
					<td width="90">
						<a href="#Diploma/Index/View?ID=<?php _e($a["ID"]);?>"><?php _e($a['subtype_title']);?><?php if($a['prior']==3){_e("<img src='".baseUrl()."/style/images/hight.gif' />");}?></a>
					</td>
					<td  width="100"><a href="#Diploma/Index/View?ID=<?php _e($a["ID"]);?>"><?php _e(short_title(strip_tags($a['code'],''),14));?>
					
					</a></td>
					
					<td align="center"><a href="#Diploma/Index/View?ID=<?php _e($a["ID"]);?>"><?php _e(show_date(DATE_FORMAT,$a['date_get']));?></a></td>
					
					<td align="center"><a href="#Diploma/Index/View?ID=<?php _e($a["ID"]);?>"><?php _e(show_date(DATE_FORMAT,$a['date_enactment']));?></a></td>
					
					<td width="140"><a href="#Diploma/Index/View?ID=<?php _e($a["ID"]);?>"><?php _e(short_title(strip_tags($a['ogran_by'],''),20));?></a></td>
					
					<td><?php _e(short_title(strip_tags($a['abstracts'],''),40));?></td>
					
					<td align="center" width="25">
						<?php if($a['created_by_id']==$this->get('user_id')){?>
						<a title="Sửa công văn" href="#Diploma/Index/edit?ID=<?php _e($a['ID']);?>" class="x-edit"></a>
						<?php }else{?>
						<a  class="x-noedit"></a>
						<?php }?>
					</td>
					<td align="center" width="25">
					<?php if($a['created_by_id']==$this->get('user_id')){?>
						<a title="Xóa công văn" onclick="module_delete('<?php _baseUrl()?>/Diploma/Index/delete?ID=<?php _e($a['ID']);?>')" class="x-delete"></a>
					<?php }else{?>
						<a  class="x-nodelete"></a>
						<?php }?>
					</td>
					<td align="center">
						<input name="ID[]" value="<?php _e($a['ID'])?>" type="checkbox" class="x-checkbox x-checkall"/>
					</td>
				</tr>
			<?php }
			?>
				<tr>
					<td colspan="11" class="page">
						<div class="x-page">
							<?php $this->e("page");?>
						</div>		
					</td>
				</tr>
			<?php
			}
			?>
		</table>
		
	</form>
